{config_load file=fb_lang_conf}
{literal}
<script>
function checkname (field)
{
	url = '../../checkfield.php?type=username';
	checkitxmlhttp = new myXMLHttpRequest ();
	checkitxmlhttp.open ("POST", url, true);
	checkitxmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	checkitxmlhttp.onreadystatechange = function () {
		if (checkitxmlhttp.readyState == 4) {
		responsestring = checkitxmlhttp.responseText;
			if (responsestring == 'OK') {
				document.getElementById ('reg_usernamecheckitvalue').innerHTML = '<span style="padding:2px;color:#167F0F">' + responsestring + '</span>';
			} else {
				document.getElementById ('reg_usernamecheckitvalue').innerHTML = '<span style="padding:2px;color:#AA0200">Taken</span>';
			}
		}
	}
  checkitxmlhttp.send ('name=' + encodeURIComponent(field.value));
  return false;
}
</script>
{/literal}

{literal}
<style type="text/css">
.register-left{
	float:left;
	border-right:1px solid #eee;
	margin-left:0;
	width:50%;
}
.register-right {
	float:left;
	width:50%;
}
.facebook_bar {
	margin:0;
	padding:6px 10px 8px;
	width:100%;
	box-shadow:0 1px 2px rgba(0, 0, 0, 0.5);
	background: -moz-linear-gradient(top, rgba(0,0,0,0.58) 2%, rgba(0,0,0,0.58) 15%, rgba(0,0,0,1) 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(2%,rgba(0,0,0,0.58)), color-stop(15%,rgba(0,0,0,0.58)), color-stop(100%,rgba(0,0,0,1)));
	background: -webkit-linear-gradient(top, rgba(0,0,0,0.58) 2%,rgba(0,0,0,0.58) 15%,rgba(0,0,0,1) 100%);
	background: -o-linear-gradient(top, rgba(0,0,0,0.58) 2%,rgba(0,0,0,0.58) 15%,rgba(0,0,0,1) 100%);
	background: -ms-linear-gradient(top, rgba(0,0,0,0.58) 2%,rgba(0,0,0,0.58) 15%,rgba(0,0,0,1) 100%);
	background: linear-gradient(to bottom, rgba(0,0,0,0.58) 2%,rgba(0,0,0,0.58) 15%,rgba(0,0,0,1) 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#94000000', endColorstr='#000000',GradientType=0 );
}
</style>
{/literal}

<div class="facebook_register_wrapper">

	<div class="facebook_bar">
		<img src="{$my_base_url}{$my_pligg_base}/modules/fb/images/facebook_white.png" width="103px" height="30px" alt="Facebook" />
	</div>

	<h1 style="font-size:24px;color:#3B5998;margin:12px 0 2px 0;padding:0;">{#PLIGG_FB_WELCOME_FACEBOOK_USER#}</h1>
	<p>{#PLIGG_FB_To_start_using_the_site#}</p> 

	<div class="register-left col-md-4">
		<h3 style="color:#3B5998;">{#PLIGG_FB_Create_a_New_Account#}</h3>
		<p>{#PLIGG_FB_Dont_have_an_account_yet#}</p>
		<form method="post" id="thisform">
			<strong>{#PLIGG_FB_Username#}</strong><br />
			<div class="facebook_username_input">
				<input class="form-control" style="margin:3px 0;" type="text" onchange="checkname(this)" name="reg_username" id="reg_username" value="{if isset($reg_username)}{$reg_username}{/if}" size="25" tabindex="10" maxlength="32"/> <span id="reg_usernamecheckitvalue" style="background:#fff;margin:2px 0;font-weight:bold;"></span>
			</div>
			{if $error}
				<div class="alert alert-warning facebook_username_error">
					<a class="close" data-dismiss="alert" href="#" aria-hidden="true">&times;</a>
					{$error}
				</div>
			{/if}
			{include file=$fb_tpl_path."fb_fields.tpl"}
			<br />
			{config_load file=fb_lang_conf}
			<input type="submit" name="submit" value="{#PLIGG_FB_Create_New_User#}" class="btn btn-primary" tabindex="16" />
			<input type="hidden" name="regfrom" value="full"/>
		</form>
	</div>

	<div class="register-right col-md-4">
		<h3 style="color:#3B5998;">{#PLIGG_FB_Existing_Account#}</h3>
		<p>{#PLIGG_FB_Enter_your_existing_login_credentials#}</p>
		<form action="{$URL_login}" method="post">	
			<strong>Username:</strong><br />
				<input type="text" name="username" class="form-control" value="{if isset($login_username)}{$login_username}{/if}" tabindex="10" /><br />
				<strong>Password:</strong><br />
				<input type="password" name="password" class="form-control" tabindex="11" />
				<br />
			<input type="hidden" name="processlogin" value="1"/>
			<input type="hidden" name="return" value="{$templatelite.get.return|sanitize:3}"/>
			<input type="checkbox" name="persistent" tabindex="12" /> {#PLIGG_FB_Keep_me_logged_in#}
			<br style="margin-bottom:2px" />
			{include file=$fb_tpl_path."fb_fields.tpl"}
			<br />
			{config_load file=fb_lang_conf}
			<input type="submit" value="{#PLIGG_FB_Connect_Existing_Account#}" class="btn btn-primary" tabindex="13" />
		</form>
	</div>

</div>

{config_load file=fb_pligg_lang_conf}